<?php

namespace Home\Model;

use Think\Model;

/**
 * 用户
 * @author Administrator
 * 
 */
class RememberLoginModel extends Model{
	
	/**
	 * 获取记住密码记录
	 * 
	 * @param string $hash	记住密码的字符串
	 * @return array|boolean
	 */
	public function getRememberRecord($hash) {
		return $this->where(array('hash' => $hash, 'status' => 1))->find();
	}
	
	/**
	 * 弃用一个记住密码的记录
	 * 
	 * @param string $hash	记住密码的字符串
	 */
	public function discardRecord($hash) {
		return $this->where(array('hash' => $hash, 'status' => 1))->save(array('status' => 1));
	}
}

?>